package javass;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Test {
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		ConnectionUtil connutil=new ConnectionUtil();
		Connection conn=connutil.getConn();
		PreparedStatementUtil psu=new PreparedStatementUtil();
		ResultSetUtil rsu=new ResultSetUtil();
		String sql=" select * from student ";
		PreparedStatement ps=psu.getPreparedStatement(conn, sql);
		ResultSet rs=rsu.getResultSet(ps);
		while(rs.next()){
			System.out.println(rs.getString(1)+rs.getString(2)+rs.getString(3)+rs.getString(4));
		}
		conn.close();
		ps.close();
		rs.close();//有返回值时，比如select时才有结果集，才需要关闭

	}
}
